<div class="main-content">
    <div class="section__content section__content--p20">
        <div class="container-fluid">
            <div class="row m-b-30">
                <div class="col-lg-12">
                    <div class="overview-wrap">
                        <h2 class="title-1"><?php echo $id == 0 ? "新建用户组" : "编辑用户组" ?></h2>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-lg-12">
                    <div class="card">
                        <div class="card-header">
                            <strong><?php echo $id == 0 ? "新建用户组" : "编辑用户组" ?></strong>
                        </div>
                        <div class="card-body">
                            <form name="form_edit" id="form_edit" action="index.php?r=admin/group/edit" method="post">
                                <input type="hidden" value="<?php echo $group['id']; ?>" name="id"/>
                                <input type="hidden" name="YII_CSRF_TOKEN" value="<?php echo Yii::app()->request->csrfToken; ?>" />

                                <div class="form-group">
                                    <label class=" form-control-label">组名</label>
                                    <input type="text" name="groupname" class="form-control validate[required]" value="<?php echo $group['groupname']; ?>" />
                                </div>

                                <div class="form-group">
                                    <button  type="submit" name="submit" id="submit" class="btn btn-primary btn-lg btn-block" onclick="save()" >保存</button>
                                </div>

                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<link rel="stylesheet" type="text/css"  href="<?php echo Yii::app()->request->baseUrl ?>/css/admin/validationEngine/css/validationEngine.jquery.css"/>
<script src="<?php echo Yii::app()->request->baseUrl ?>/css/admin/validationEngine/jquery.validationEngine.js"></script>
<script src="<?php echo Yii::app()->request->baseUrl ?>/css/admin/validationEngine/jquery.validationEngine-zh_CN.js"></script>
<script>
    $(function(){
        $("#form_edit").validationEngine({promptPosition:'inline',scroll:false});
    });
    function save(){
        if($("#form_edit").validationEngine('validate')){
            document.forms['form_edit'].submit();
        }
    }
</script>